/*
  路由模块
*/
import Vue from 'vue'
import VueRouter from 'vue-router'
// import Msite from '@/pages/Msite/Msite'
// import Order from '@/pages/Order/Order'
// import Profile from '@/pages/Profile/Profile'
// import Search from '@/pages/Search/Search'
// import Login from '@/pages/Login/Login'
// import Shop from '@/pages/Shop/Shop'
// import ShopGoods from '@/pages/Shop/ShopGoods/ShopGoods'
// import ShopRatings from '@/pages/Shop/ShopRatings/ShopRatings'
// import ShopInfo from '@/pages/Shop/ShopInfo/ShopInfo'
const Msite = () => import('@/pages/MSite/MSite.vue')
const Search = () => import('@/pages/Search/Search.vue')
const Order = () => import('@/pages/Order/Order.vue')
const Profile = () => import('@/pages/Profile/Profile.vue')
const Login = () => import('@/pages/Login/Login')
const Shop = () => import('@/pages/Shop/Shop')
const ShopGoods = () => import('@/pages/Shop/ShopGoods/ShopGoods')
const ShopRatings = () => import('@/pages/Shop/ShopRatings/ShopRatings')
const ShopInfo = () => import('@/pages/Shop/ShopInfo/ShopInfo')

Vue.use(VueRouter)


// 全局注册Vue-router组件
Vue.use(VueRouter)

// 配置路由表并导出
export default new VueRouter({
  routes: [
    {
      path: '/msite',
      component: Msite,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/order',
      component: Order,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/profile',
      component: Profile,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/search',
      component: Search,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/',
      component: Msite,

    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/shop',
      component: Shop,
      children: [
        {
          path: '/shop/goods',
          component: ShopGoods
        },
        {
          path: '/shop/ratings',
          component: ShopRatings
        },
        {
          path: '/shop/info',
          component: ShopInfo
        },
        {
          path: '',
          redirect: '/shop/goods'
        }
      ]
    }

  ]

})
